package itheima.zuoye.test3;



public class Account {

    private final int accountNumber; // 账号
    private String name;
    private double money;
    private static double interestRate = 0.03; // 利率
    private static double minAmount = 10.0; // 最小金额
    static int count = 1001; // 静态计数器

    public Account(int accountNumber, String name, double money) {
        this.accountNumber = count++;
        this.name = name;
        this.money = money;
    }

    // Getter方法
    public int getAccountNumber() { return accountNumber; }
    public String getName() { return name; }
    public double getMoney() { return money; }
    public static double getInterestRate() { return interestRate; }
    public static double getMinAmount() { return minAmount; }

    // Setter方法
    public void setName(String name) { this.name = name; }
    public void setMoney(double money) { this.money = money; }
    public static void setInterestRate(double interestRate) { Account.interestRate = interestRate; }
    public static void setMinAmount(double minAmount) { Account.minAmount = minAmount; }

    @Override
    public String toString() {
        return "Account{" +
                "accountNumber=" + accountNumber +
                ", password='" + name+ '\'' +
                ", balance=" + money +
                ", interestRate=" + interestRate +
                ", minAmount=" + minAmount +
                '}';

    }
}

